package com.lqs.dataservice.Controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lqs.dataservice.Service.RepairService;
import com.lqs.dataservice.entity.Repair;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
/**
 * ArmyController
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2019-12-27 14:45
 */
@Component
public class RepairController  implements GraphQLQueryResolver, GraphQLMutationResolver{
    @Autowired
    RepairService repairService;

    public Repair findRepairById(String id) {
        return repairService.findRepairById(id);
    }

    public List<Repair> findAllByRepState(String repState) {
        return repairService.findAllByRepState(repState);
    }

    public Response saveRepair(Repair entity) {
        return repairService.saveRepair(entity);
    }

    public Response deleteRepairById(String id) {
        return repairService.deleteRepairById(id);
    }

}
